<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<style>

body { margin: 0; }
.rel { position: relative; }
.abs { position: absolute; }
.fix { position: fixed; }

</style>
<div class="rel">
  <div class="abs">
    <div class="fix">fixed</div>
  </div>
</div>
<script>

test(() => {
  var abs = document.querySelector(".abs");
  var fix = document.querySelector(".fix");

  assert_equals(fix.offsetTop, 0);

  abs.style.top = "100px";
  assert_equals(fix.offsetTop, 100);
}, "Abs-pos in rel-pos container updates fixed-pos child when moved.");

</script>
